//https://codeforces.com/contest/1041/submission/279277699
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
const int N = 2e5 + 10;
using ll = long long;
pair <ll, ll> a[N], dp[N];
ll mod = 1e9 + 7;

void solve()
{
    int n, h; cin >> n >> h;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i].first >> a[i].second;
    }
    int l = 1, r = 1;
    ll ans = 0, cur = 0;
    while (l <= n && r <= n)
    {
        while (cur >= h)l++, cur -= a[l].first - a[l - 1].second;
        ans = max(ans, a[r].second - a[l].first + (h - cur));
        r++, cur += a[r].first - a[r - 1].second;
    }
    cout << ans << "\n";
}

int main()
{
    int _ = 1; //cin >> _;
    while (_--)
        solve();

    return 0;
}